<template>
  <div class="hello">
    <el-container>
      <el-header style="height: 180px;width: 540px;margin: 20px auto;">
        <div class="title-container">
          <h3 class="title">高等教育作业管理系统</h3>
          <h3 class="title">教学秘书注册</h3>
        </div>
      </el-header>
      <el-main style="margin: 0 auto;width: 540px;">
        <!--  教学秘书登录 -->
        <el-form :model="teacherSecretaryForm" status-icon :rules="rules" ref="ruleForm" class="demo-ruleForm">
          <el-form-item label="账号" prop="teacherSecretaryNum">
            <el-input type="text" placeholder="请输入账号" v-model="teacherSecretaryForm.teacherSecretaryNum"></el-input>
          </el-form-item>
          <el-form-item label="密码" prop="teacherSecretaryPassword">
            <el-input type="password" placeholder="请输入密码" v-model="teacherSecretaryForm.teacherSecretaryPassword"></el-input>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" @click="submitForm('ruleForm')">立即注册</el-button>
            <el-button @click="resetForm('ruleForm')">重置</el-button>
            <router-link to="/teacherSecretaryLogin">
              <el-button>前往登录</el-button>
            </router-link>
          </el-form-item>
        </el-form>
      </el-main>
      <el-footer style="width: 540px;margin: 10px auto;">
        <div>
          <router-link to="/">
            <el-button type="primary" size="mini">管理员登录</el-button>
          </router-link>
          <router-link to="/leaderLogin">
            <el-button type="primary" size="mini">领导登录</el-button>
          </router-link>
          <router-link to="/teacherLogin">
            <el-button type="primary" size="mini">教师登录</el-button>
          </router-link>
          <router-link to="/teacherSecretaryLogin">
            <el-button type="primary" size="mini">教学秘书登录</el-button>
          </router-link>
          <router-link to="/studentLogin">
            <el-button type="primary" size="mini">学生登录</el-button>
          </router-link>
        </div>
      </el-footer>
    </el-container>
  </div>
</template>

<script>
export default {
  name: 'teacherSecretaryLogin',
  data () {
    return {
      teacherSecretaryForm: {
        teacherSecretaryNum: '',
        teacherSecretaryPassword: ''
      },
      rules: {
        teacherSecretaryNum: [
          { required: true, message: '请输入账号', trigger: 'blur' },
          { min: 6, max: 10, message: '长度在 6 到 10 个字符', trigger: 'blur' }
        ],
        teacherSecretaryPassword: [
          { required: true, message: '请输入密码', trigger: 'blur' },
          { min: 6, max: 15, message: '长度在 6 到 15 个字符', trigger: 'blur' }
        ]
      },
      loading: false,
      passwordType: 'teacherPassword',
      redirect: undefined
    }
  },
  methods: {
    submitForm (formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          alert('submit!')
        } else {
          console.log('error submit!!')
          return false
        }
      })
    },
    resetForm (formName) {
      this.$refs[formName].resetFields()
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
  .el-header, .el-footer {
    background-color: #c6d1dc;
    color: #333;
    text-align: center;
    line-height: 60px;
  }

  .el-aside {
    background-color: #D3DCE6;
    color: #333;
    text-align: center;
    line-height: 200px;
  }

  .el-main {
    background-color: #E9EEF3;
    color: #333;
    text-align: center;
    line-height: 160px;
  }

  body > .el-container {
    margin-bottom: 40px;
  }

  .el-container:nth-child(5) .el-aside,
  .el-container:nth-child(6) .el-aside {
    line-height: 260px;
  }

  .el-container:nth-child(7) .el-aside {
    line-height: 320px;
  }
  .login-form{
    width: 500px;
  }
</style>
